package vashion.azeroth.api.controller.item;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import vashion.azeroth.api.controller.base.BaseController;
import vashion.azeroth.contant.AzerothConstants;
import vashion.azeroth.core.item.pojo.ForestPropertyDO;
import vashion.azeroth.core.item.pojo.ForestPropertyValueDO;
import vashion.azeroth.core.manager.forest.BaseForestPropertyManager;
import vashion.azeroth.core.result.ApiResult;

import java.util.List;

/**
 * 类目属性维护
 *
 * @param <T>
 */
@Controller
@RequestMapping("/api/forestproperty")
public class ForestPropertyController<T> extends BaseController {

    private final static Logger log = LoggerFactory.getLogger(ForestPropertyController.class);

    @Autowired
    private BaseForestPropertyManager baseForestPropertyManager;

    /**
     * 获取属性列表
     *
     * @return
     */
    @RequestMapping("getForestPropertyList.htm")
    @ResponseBody
    public ApiResult<List<ForestPropertyDO>> getForestPropertyList(long forestId) {

        return baseForestPropertyManager.getForestPropertyList(forestId, AzerothConstants.ItemForestProperty.NORMAL);
    }
    
    /**
    * 获取属性列表
    *
    * @return
    */
   @RequestMapping("getForestPropertyValues.htm")
   @ResponseBody
    public ApiResult<ForestPropertyValueDO> getForestPropertyValues(long forestId) {
    	return baseForestPropertyManager.getForestPropertyValues(forestId, AzerothConstants.ItemForestProperty.NORMAL);
    }

}
